
MMLIBS   = $(LDFLAGS) -lusb -lsqlite3 -lpthread
MMCFLAGS = $(LDFLAGS) -static
CFLAGS += -static -DHAVE_LIBFREETYPE $(INCL)

# Data to make metermon 
MMOBJ = metermon.o poll_meters.o database.o ueib.o
MMHDR = meter.h ueib.h

all: metermon sysupdate metermonctrl test

metermon: $(MMOBJ) $(MMHDR)
	$(CC) $(CFLAGS) $(MMOBJ) $(MMLIBS) -o metermond
#	$(CC) $(MMCFLAGS) $(MMOBJ) $(MMLIBS) -o metermond

sysupdate: sysupdate.c
	$(CC) sysupdate.c -o sysupdate.cgi
metermonctrl: metermonctrl.c
	$(CC) metermonctrl.c -o metermonctrl

test: test.o ueib.o ueib.h
	$(CC) $(MMCFLAGS) test.o ueib.o $(MMLIBS) -o test



.c.o: 
	$(CC) $(CFLAGS) -c $*.c


clean:
	rm *.o
	rm metermond test sysupdate.cgi

